﻿// JScript 文件


//platform:1--订单列表,2--订单详情,3--待支付页面
//20160518 增加参数cashType,如果cashType=2,支付尾款，则不需要判断paid_amount是否为0
function onlinePayCheck(id,orderid,url,platform,cashType)
{
    
    var outputDataUrl = "./outputData.aspx";
    var re_flg = false;
    var myurl = outputDataUrl;
    
    
    jQuery.ajax({  
        type : "get",  
        url : myurl,  
        data : {Dtype:"onlinepaycheck",Id:orderid,d:new Date(),cashType:cashType},  
        async : false,  
        success : function(data){  
            var tex =data;	 
             
            if(tex=='true' || tex=='True')
            {
                //可以支付
                //window.location.href=url;
                //window.open(url,"_blank");
                re_flg = true;
            }
            else
            {
                //不可以支付
                var lin =  jQuery(m_tagbox).get(0);
                var text="您的订单已支付，请等待片刻";   
                if(platform == 2)  
                {
                    jQuery(lin).html(onlinePayFailDetailJS(text,platform)); 
                }
                else
                {
                    jQuery(lin).html(onlinePayFailJS(text,platform)); 
                }

                var pos = jQuery("#"+id).offset();

                new dragObject(lin, "handle", null, null, null, null, null, false);
                 
                lin.style.left= pos.left - 260  + "px";
                lin.style.top = pos.top + "px";	
                lin.style.zIndex = 2;			
                lin.style.display="block";	 
                re_flg = false;
            }
        }  
    });  
    return re_flg;
}

function onlinePayFailJS(text,mplatform)
{     
    var sb = new StringBuilder('<div class="myddorder_popup myddorder_popup_receive">'); 
    sb.append('<div class="myddorder_popup_title">');
    sb.append('<h2>支付提示</h2><a href=\"javascript:hidden_for_onlinePayFail('+ mplatform + ');\" class="close" title="关闭">关闭</a>');
    sb.append('</div>');
    sb.append('<div class="myddorder_popup_main">');
    sb.append('<p>此次交易您已成功支付，谢谢！</p>');
    sb.append('<div class="myddorder_popup_btn"><button onclick=\"javascript:hidden_for_onlinePayFail('+ mplatform +');\">关闭窗口</button></div>');
    sb.append('</div>');
    sb.append('</div>');
    return sb.getString();
}


function onlinePayFailDetailJS(text,mplatform)
{     
    var sb = new StringBuilder('<div class="ddnew_window window_surveyok window_waiting">');    
    sb.append('<h2><span>支付提示</span><a href=\"javascript:hidden_for_onlinePayFail('+ mplatform + ');\" class="w_close">关闭窗口</a></h2>');
    sb.append('<div class="window_content">');
    sb.append('<p>此次交易您已成功支付，谢谢！</p>');
    sb.append('<p class="split_ok" ><input name="" type="button" value="关闭窗口"  onclick=\"javascript:hidden_for_onlinePayFail('+ mplatform +');\"/></p>');
    sb.append('</div>');
    sb.append('</div>');
    return sb.getString();
}


function hidden_for_onlinePayFail(mplatform)
{  
    var lin = document.getElementById("tag_box");
    if(lin)
        lin.style.display="none";
    
    var href_str=location.href
    var pos = href_str.indexOf("myallorders");

    if(pos < 0  && mplatform!=2)
    {
        loadData_forsucceedorder('payorder','0|1|0','true');       
        return
    }
    if(mplatform==1)        
    {
        //loadData_forsucceedorder('order','3|1|0','true');
        loadData_searchOrder('searchorder','3|1|0',0);
    }
    else if(mplatform==2)        
    {
        window.location.reload(true); 
    }
    else if(mplatform==3)     
    {   
       loadData_forsucceedorder('payorder','0|1|0','true');
    }
}






//added by lsp 2012.5.17 团购
function display_tuan_details(Id,orderid)
{
    var outputDataUrl = "./outputData.aspx";
    
    var myurl = outputDataUrl;
    
    jQuery.get(myurl,{Dtype:"gettuandetails",Id:orderid,d:new Date()},
        function(data)
        {
            var tex = eval('(' + data + ')');

            var lin =  document.getElementById("tuan_pop");   
           
            if(!lin)return;
            lin.innerHTML = get_tuan_details(tex);
           
            var pos = getPosition(document.getElementById(Id));
            //new dragObject(lin, "handle", null, null, null, null, null, false);
            
            lin.style.left= pos.x - 450 + "px";
            lin.style.top = pos.y + "px";			
            lin.style.display="block";	
            
		    jQuery('.tuan_pop .tuan_phone').click(function () {
			    
			    //已发送短信次数
			    var sms_time;
			    if(jQuery(this).get(0).getAttribute("sms_times"))
			        sms_time = jQuery(this).get(0).getAttribute("sms_times");
			    else
			        sms_time = 0;
			    
			    //发送短信总数
			    var sms_total;
			    if(jQuery(this).get(0).getAttribute("sms_total"))
			        sms_total = jQuery(this).get(0).getAttribute("sms_total");
			    else
			        sms_total = 0;
			    
			    //订单号
			    var order_id;
			    if(jQuery(this).get(0).getAttribute("order_id"))
			        order_id = jQuery(this).get(0).getAttribute("order_id");
			    else
			        order_id = 0;
			        
			    //优惠券编号
			    var item_no;
			    if(jQuery(this).get(0).getAttribute("item_no"))
			        item_no = jQuery(this).get(0).getAttribute("item_no");
			    else
			        item_no = 0;
			    
			    //消费验证码
			    var consume_code;
			    if(jQuery(this).get(0).getAttribute("consume_code"))
			        consume_code = jQuery(this).get(0).getAttribute("consume_code");
			    else
			        consume_code = 0;
			    
			    var consume_verify;   
			    if(jQuery(this).get(0).getAttribute("consume_verify"))
			        consume_verify = jQuery(this).get(0).getAttribute("consume_verify");
			    else
			        consume_verify = "";
			    
			    var effect_start_date;
			    if(jQuery(this).get(0).getAttribute("effect_start_date"))
			        effect_start_date = jQuery(this).get(0).getAttribute("effect_start_date");
			    else
			        effect_start_date = 0;
			    
			    var effect_end_date;
			    if(jQuery(this).get(0).getAttribute("effect_end_date"))
			        effect_end_date = jQuery(this).get(0).getAttribute("effect_end_date");
			    else
			        effect_end_date = 0;
			    
			    
			    var sms_time_left = parseInt(sms_total) - parseInt(sms_time);
			    if(sms_time_left < 0)
			        sms_time_left = 0;
			    
			    var html = get_send_mobile(sms_time_left,sms_total);
			    jQuery('.tuan_pop .operate').css('z-index', '0');
			    jQuery('.tuan_phone_pop').remove();
			    jQuery(this).after(html);
			    jQuery(this).parents('.operate').css('z-index', '1');
			    jQuery('.tuan_phone_pop .cancel').click(function () {
				    jQuery('.tuan_phone_pop').remove();

			    });
			    jQuery('.tuan_phone_pop .send').click(function () {
				    //发送短信				    
				    send_tuan_sms(sms_total,sms_time_left,order_id,item_no,consume_code,consume_verify,effect_start_date,effect_end_date,Id);
				    jQuery('.tuan_phone_pop').remove();
			    });
		    });
        }
    );
    
   jQuery('.tuan_pop').hover(function () {
		jQuery(this).show();
	}, function () {
		jQuery(this).hide();
	});
	
	

}

//added by lsp 2012.5.17 团购
function hide_tuan_details()
{
    //var items = jQuery('.tuan_pop').show();
    var lin =  document.getElementById("tuan_pop");   
    if(!lin)return;
    lin.style.display="none";	

}

///团购显示订单详情浮层
function get_tuan_details(data)
{
    var sb = new StringBuilder();
    if(data && data != null && data != undefined)
    {
        sb.append('<table width="100%" cellpadding="0" cellspacing="0">');
        sb.append('<thead>');
        sb.append('<tr>');
        sb.append('<td>优惠券号</td>');
        sb.append('<td>密码</td>');
        sb.append('<td>操作</td>');
        sb.append('</tr>');
        sb.append('</thead>');
        
        sb.append('<tbody>');
        
        if(data.rows[0].AllotItems.length && data.rows[0].AllotItems.length > 0)
        {
            for(var i = 0;i<data.rows[0].AllotItems.length;i++)
            {
                var item = data.rows[0].AllotItems[i];
                sb.append('<tr>');
                sb.append('<td>'+ item.consume_code +'</td>');
                sb.append('<td>'+ item.consume_verify +'</td>');
                sb.append('<td class="operate" >');
                sb.append('<a href="javascript:void(0);"  class="tuan_phone" sms_times=\"'+ item.sms_times +'\" sms_total = \"'+ item.sms_total +'\" order_id = \"'+ item.order_id +'\" item_no = \"'+ item.item_no +'\" consume_code = \"'+ item.consume_code +'\" consume_verify = \"'+ item.consume_verify +'\" effect_start_date = \"'+ item.effect_start_date +'\" effect_end_date = \"'+ item.effect_end_date +'\">重发至手机</a>');
                //sb.append('<br />');
                //sb.append('<a href="#">打印优惠券</a>');
                sb.append('</td>');
                sb.append('</tr>');
            }
        }
        
        sb.append('</tbody>');
        sb.append('</table>');
    }
    return sb.getString();
}

//获取发送手机验证码弹窗HTML
function get_send_mobile(sms_time,sms_total)
{
    var sb = new StringBuilder();
    sb.append('<div class="tuan_phone_pop">');
    sb.append('<p>手机号 <input type="text" id="tuan_phone_tel" class="text" /></p>');
    sb.append('<p>总共能发'+ sms_total +'次, 您还剩<span class="red">'+sms_time+'</span>次</p>');
    sb.append('<div class="btn">');
    sb.append('<a href="javascript:void(0);" class="send">确定</a>');
    sb.append('<a href="javascript:void(0);" class="cancel">取消</a>');
    sb.append('</div>');
    sb.append('</div>');
    return sb.getString();
}

//团购显示重新发送手机验证码
function send_tuan_sms(sms_total,sms_time_left,order_id,item_no,consume_code,consume_verify,effect_start_date,effect_end_date,id)
{
   //手机号
    var mobile_tel;
    if(jQuery('#tuan_phone_tel') && jQuery('#tuan_phone_tel').val() && jQuery('#tuan_phone_tel').val() != 0)
        mobile_tel = jQuery('#tuan_phone_tel').val();
    else
        mobile_tel = 0;
    
    if(mobile_tel==0 || mobile_tel== null || mobile_tel== undefined || mobile_tel=="")
    {
        alert("请输入手机号码");
        return;
    }
    if(isNaN(mobile_tel)||(mobile_tel.length!=11)){
        alert("手机号码为11位数字！请正确填写！");
        return;
    }
    var reg =/^0{0,1}(13[0-9]|15[0-9])[0-9]{8}$/;
    if(!reg.test(mobile_tel))
    {
        alert("您的手机号码不正确，请重新输入");
        return;
    }
    else if(parseInt(sms_time_left) < 0 || sms_time_left == 0)
    {
        alert("验证码只能发送" + sms_total + "次");
        return;
    }
    else
    {
        var outputDataUrl = "./outputData.aspx";
        var myurl = outputDataUrl;
        jQuery.post(myurl,{DtypePost:"sendtuansms",Id:order_id,Mobile:mobile_tel,ItemNo:item_no,ConsumeCode:consume_code,ConsumeVerify:consume_verify,EffectStartDate:effect_start_date,EffectEndDate:effect_end_date,d:new Date()},
            function(data)
            {
                var tex = eval('(' + data + ')');
                if(parseInt(tex.statusCode) == 0)
                {
                    //发送成功
                    var lin =  document.getElementById("tag_box");   
                    if(!lin)return;
                    lin.innerHTML = sms_succeed();

                    var pos = getPosition(document.getElementById(id));

                    new dragObject(lin, "handle", null, null, null, null, null, false);
                     
                    lin.style.left= pos.x - 200  + "px";
                    lin.style.top = pos.y + "px";			
                    lin.style.display="block";	
                    hide_tuan_details();
                    return;
                }
                if(parseInt(tex.statusCode) == 4)
                {
                    alert("手机号不符合规则");
                    return;
                }
                if(parseInt(tex.statusCode) == 5)
                {
                    alert("已经超过发送次数");
                    return;
                }
                if(parseInt(tex.statusCode) == 1)
                {
                    alert("更新次数失败");
                    return;
                }
                if(parseInt(tex.statusCode) == 2)
                {
                    alert("更新日志失败");
                    return;
                }
                if(parseInt(tex.statusCode) == 3)
                {
                    alert("插入短信队列失败");
                    return;
                }

            }
        );
    }
}

function sms_succeed()
{
    var sb = new StringBuilder();
    
    sb.append('<div class="myddorder_popup_wrap  myddorder_popup_cancel" id="e1">');
	sb.append('<div class="myddorder_popup" id="handle">');
	sb.append('<div class="myddorder_popup_title">');
	sb.append('<h2>短信发送</h2>');
	sb.append('<a title="关闭" class="close" href="javascript:hidden();">关闭</a></div>');
	sb.append('<div class="myddorder_popup_main">');
	sb.append('<h3 class="icon_none"><span>已发送</span></h3>');
	sb.append('<div class="myddorder_popup_btn">');
	sb.append('<button onclick="javascript:hidden_for_cancel();">关闭</button>');
	sb.append('</div>');
	sb.append('</div>');
	sb.append('</div>');
	sb.append('</div>');
    
    return sb.getString();
}

//团购取消订单 added by lsp 2012.5.23
function cancel_orders_tuan_tip(id,order_id,source_id)
{
    var lin =  jQuery(m_tagbox).get(0);
    if(!lin) return;
    lin.innerHTML = cancelOrderJSTuan(id,order_id,source_id);
    
    var pos = jQuery("#"+id).offset();    

    new dragObject(lin, "handle", null, null, null, null, null, false);
     
    lin.style.left= pos.left - 300  + "px";
    lin.style.top = pos.top + "px";			
    lin.style.display="block";	  
}

function cancelOrderJSTuan(id,order_id,source_id)
{
    var sb = new StringBuilder();
    sb.append('<div class="myddorder_popup_wrap myddorder_popup_cancel">');
	sb.append('<div class="myddorder_popup">');
	sb.append('<div id="handle" class="myddorder_popup_title">');
	sb.append('<h2>取消订单</h2>');
	sb.append('<a href="javascript:hidden();"  class="close" title="关闭">关闭</a>');
	sb.append('</div>');
	sb.append('<div class="myddorder_popup_main">');
	sb.append('<h3 class="icon_warning status1"><i></i><span>您确定取消订单 ' + order_id + '？</span></h3>');
	sb.append('</p>');
	sb.append('<div class="myddorder_popup_btn">');
	//sb.append('<button>确 定</button>');
	sb.append('<button name="confirm"  id="btn_OrderCancel" onClick=javascritpt:cancel_orders_tuan("',id,'","',order_id,'","',source_id,'");>确 定</button>');
	//sb.append('<button class="btn2">取 消</button>');
	sb.append('<button  name="cancel"  class="btn2"  onclick="javascript:hidden_for_cancel();" >关 闭</button>');  
	sb.append('</div>');
	sb.append('</div>');
	sb.append('</div>');
	sb.append('</div>');
    return sb.getString();
}

function cancel_orders_tuan(id,order_id,source_id)
{
    var outputDataUrl = "./outputData.aspx";
    var myurl = outputDataUrl;
    jQuery.get(myurl,{Dtype:"cancelordertuan",Id:order_id,SourceId:source_id,d:new Date()},
        function(data)
        {
            var tex = eval('(' + data + ')');
            
            var lin =  jQuery(m_tagbox).get(0);
            if(!lin)return;
            jQuery(lin).html(cancelSuccJS(tex)); 
            var pos = getPosition(document.getElementById(id));
            new dragObject(lin, "handle", null, null, null, null, null, false);
           
            loadData_forsucceedorder('tuanorder','3|1|0',false);  
            lin.style.left= pos.x - 500  + "px";
            lin.style.top = pos.y + 10 + "px";				
            lin.style.display="block";  
        }
    );
}

function apply_refund_tuan(url)
{
    var outputDataUrl = "./outputData.aspx";
    
    var myurl = outputDataUrl;
    var reason = jQuery("input[name=refundReason]:checked").val();
    
    //alert(jQuery("#other_reason").val());
    if(reason=='其他原因')
        reason = jQuery("#other_reason").val();
    if(reason==undefined || reason=='')
    {
         alert("请填写申请原因");
         return;   
    }    
    
    var order_id;
    var order_code;
    var team_id; 
    var team_name; 
    var refund_quantity; 
    var total_refund_amount; 
    var cust_id;    
    
    if(jQuery("#orderinfo").get(0))
    {
        order_id = jQuery("#orderinfo").get(0).getAttribute("order_id");    
        order_code = jQuery("#orderinfo").get(0).getAttribute("order_code");    
        team_id = jQuery("#orderinfo").get(0).getAttribute("team_id");    
        team_name = jQuery("#orderinfo").get(0).getAttribute("team_name");    
        refund_quantity = jQuery("#orderinfo").get(0).getAttribute("refund_quantity");    
        cust_id = jQuery("#orderinfo").get(0).getAttribute("cust_id");
    }
    if(jQuery("#total_refund_amount"))
        total_refund_amount = jQuery("#total_refund_amount").text();
    else
        total_refund_amount = 0;
    
    if(reason.length > 250)
    {
        alert("原因必须小于250个字符");
        return;
    }
    if(reason == "填写其他原因，限250个字...")
    {
        alert("请填写退款原因");
        return;
    }
    
    
    if(order_id==undefined || order_code==undefined || team_id==undefined || team_name==undefined || refund_quantity==undefined || total_refund_amount==undefined || cust_id==undefined)
    {
        alert("页面值不能为空");
        return;
    }     
    reason = encodeURIComponent(reason);
    team_name = encodeURIComponent(team_name);

    
    
    jQuery.post(myurl,{DtypePost:"applyrefundtuan",Id:order_id,order_code:order_code,team_id:team_id,team_name:team_name,refund_quantity:refund_quantity,refund_reason:reason,total_refund_amount:total_refund_amount,cust_id:cust_id,d:new Date()},
        function(data)
        {
            var tex = eval('(' + data + ')');
            if(parseInt(tex.statusCode) == 0)
            {
                var submitForm = getRefundTuanSubmitForm();
                createNewFormElement(submitForm, "order_id", order_id);
                submitForm.action= "./RefundApplyTuanSucceed.aspx";
                //可以支付
                submitForm.submit();
                //window.open(url,"_blank");
            }
            else if(parseInt(tex.statusCode) == -3)
            {
                alert("您已经提交过申请号为 " + tex.refund_code + " 的申请，不能重复提交");
                return;
            }
            else
            {
                alert("申请有误，请联系客服。");
                return;
            }
        }
    );
}

function getRefundTuanSubmitForm(){
    var submitForm = document.createElement("FORM");
    document.body.appendChild(submitForm);
    submitForm.id="tuanRefund";        
    submitForm.method = "POST";
    submitForm.target="_self" ;
    return submitForm;
}






// ztx 银行转账中确认付款
function JsOpenwin_Transfer(OrderIds,sStartD,indate,creatDate,transferId,parameters)
{

    var lin =  jQuery(m_tagbox).get(0)
    
    
    jQuery(lin).html(confimTransfer(OrderIds,sStartD,indate,creatDate,parameters));

    //var pos = getPosition(document.getElementById(transferId));
    
    var pos = jQuery("#"+transferId).offset();
    
    new dragObject(lin, "handle", null, null, null, null, null, false);
     
     lin.style.left= pos.left - 260  + "px";
    lin.style.top = pos.top + "px";	
    lin.style.zIndex = 2;	
    lin.style.display="block";	 
    
    //added by lsp 2011-11-30 日期弹出框背景不可编辑
    jQuery(".ddnewhead_search_panel").css("zIndex","3");
    jQuery(".ddnewhead_help").css("zIndex","3");
    jQuery(".ddnewhead_mydd").css("zIndex","3");
    jQuery(".ddnewhead_gcard").css("zIndex","3");
}

//银行转账中确认付款2
function confimTransfer(orderid,sStartD,indate,creatDate,parameters)
{
    var sb = new StringBuilder('<div class="myddorder_popup_wrap">');      
    sb.append('<div class="myddorder_popup myddorder_calendar">');    
    sb.append('<div class="myddorder_popup_title" id="handle">');   
    sb.append('<h2>付款确认</h2><a href=javascript:hidden(); class="close" title="关闭">关闭</a>');
    sb.append('</div>');
 
    sb.append('<div class="myddorder_popup_main myddorder_popup_main02">');
    sb.append(' <p class="text01"><span class="fukuan_nav">汇款日期：</span><input onclick=javascript:showCalendar("alendar",false,"InDate",null,null,"',sStartD,'","',indate,'"); id="InDate" type="text" value="',indate,'" \/><a href=javascript:showCalendar("alendar",false,"InDate",null,null,"',sStartD,'","',indate,'"); target="_self" onMouseOut=window.status=""; onMouseOver=window.status="Calendar";return true;><span id="alendar">date<\/span><\/a></p>');
    
    sb.append('<p class="text01"><span class="fukuan_nav"><b>*</b>汇款人：</span><input id="t_user_name" name="" type="text" /></p>');
    
    sb.append('<p class="text01"><span class="fukuan_nav"><b>*</b>交易流水号：</span><input id="t_num" name="" type="text" /></p>');
    sb.append('<p class="text03">注：没有交易流水号，请填写000</p>');
    sb.append('<p class="text01"><span class="fukuan_nav">交易方式：</span><select id="t_way" name="">');
    sb.append('<option>现金送存</option>');
    sb.append('<option>柜台卡卡转存</option>');
    sb.append('<option>ATM转账</option></select>');
    sb.append('</p>');
    sb.append('<p class="text01"><span class="fukuan_nav"><b>*</b>交易行名称：</span><input id="t_name" type="text" value="" class="size02" /></p>');
    sb.append('<p class="text03">注：需填写汇出行名称(可见汇款底单银行印章)</p>');
    sb.append('<p class="text01"><span class="fukuan_nav"><b>*</b>支付金额：</span><input id="t_money" type="text" value="" class="size01" /><span>&nbsp;元</span></p>');
   
    sb.append(' <p class="text02">');
    sb.append('<span class="fukuan_nav">汇款备注</span>');
    sb.append('<textarea id="t_comd" name="" onkeydown="this.style.color=\'#404040\'" onblur="if(this.value==\'\'){this.value=\'请填写汇款相关信息，最多50个汉字\';this.style.color=\'#878787\'}" onfocus="if(this.value!=\'请填写汇款相关信息，最多50个汉字\'){this.style.color=\'#404040\'}else{this.value=\'\';this.style.color=\'#404040\'}" class="mode_yzm_input" value="请填写汇款相关信息，最多50个汉字">请填写汇款相关信息，最多50个汉字</textarea></p>');
    sb.append('</p>');
   
    sb.append('<div class="clear"></div>');
    sb.append('<div class="myddorder_popup_btn"><span class="wrong" id="bankconfir" style="display:none;"></span><button  name="submit" onclick="javascritpt:postDateTrans(\'',orderid,'\',\'',parameters,'\',\'',creatDate,'\');" >提 交</button></div>');    
    sb.append('</div>');
    sb.append('</div>');
    sb.append('</div>');  
    return sb.getString();
}




//银行转账中确认付款3
function postDateTrans(Id,parameters,creatDate)
{
///
    var time=jQuery("#InDate").val();  
    var num=jQuery("#t_num").val();  
    var way=jQuery("#t_way").val();  
    var name=jQuery("#t_name").val();  
    var money=jQuery("#t_money").val();  
    var comd=jQuery("#t_comd").val(); 
    var user_name=jQuery("#t_user_name").val(); 

    num = encodeURIComponent(num);
    way = encodeURIComponent(way);
    name = encodeURIComponent(name);
    comd = encodeURIComponent(comd);
    user_name = encodeURIComponent(user_name);
    
     if(num=='' && name=='' && money=='' && user_name=='')
    {
        var lin =  document.getElementById("bankconfir");
              lin.innerHTML="请您填写汇款人,交易流水号,交易行名称,支付金额";
        lin.style.display="block";
         return;
    }else if(num=='' && name=='' && user_name=='')
    {
        var lin =  document.getElementById("bankconfir");
        lin.innerHTML="请您填写汇款人,交易流水号,交易行名称";
        lin.style.display="block";
         return;
    }else if( name=='' && money=='' && user_name=='')
    {
        var lin =  document.getElementById("bankconfir");
        lin.innerHTML="请您填写汇款人,交易行名称,支付金额";
        lin.style.display="block";
         return;
    }else if( num=='' && money=='' && user_name=='')
    {
        var lin =  document.getElementById("bankconfir");
        lin.innerHTML="请您填写汇款人,交易流水号,支付金额";
        lin.style.display="block";
         return;
    }else if( num=='' && name=='' && money=='')
    {
        var lin =  document.getElementById("bankconfir");
        
        lin.innerHTML="请您填写交易流水号,交易行名称,支付金额";
        lin.style.display="block";
         return;
      }
    else if( num=='' && name=='')
    {
        var lin =  document.getElementById("bankconfir");
        lin.innerHTML="请您填写交易流水号,交易行名称";
        lin.style.display="block";
         return;
    }
    else if( num=='' && money=='')
    {
        var lin =  document.getElementById("bankconfir");
        lin.innerHTML="请您填写交易流水号,支付金额";
        lin.style.display="block";
         return;
    }
    else if( num=='' && user_name=='')
    {
        var lin =  document.getElementById("bankconfir");
        lin.innerHTML="请您填写汇款人,交易流水号";
        lin.style.display="block";
         return;
    }
    else if( name=='' && money=='')
    {
        var lin =  document.getElementById("bankconfir");
        
        lin.innerHTML="请您填写交易行名称,支付金额";
        lin.style.display="block";
         return;
    }
    else if( name=='' && user_name=='')
    {
        var lin =  document.getElementById("bankconfir");
        lin.innerHTML="请您填写汇款人,交易行名称";
        lin.style.display="block";
         return;
    }
     else if( money==''&& user_name=='')
    {
        var lin =  document.getElementById("bankconfir");
        lin.innerHTML="请您填写汇款人,支付金额";
        lin.style.display="block";
         return;
    }
    else if(num=='')
    {
        var lin =  document.getElementById("bankconfir");
        lin.innerHTML="请您填写交易流水号";
        lin.style.display="block";
         return;
    }else if(name=='')
    {
        var lin =  document.getElementById("bankconfir");
        lin.innerHTML="请您填写交易行名称";
        lin.style.display="block";
         return;
    }else if(money=='')
    {
        var lin =  document.getElementById("bankconfir");
        lin.innerHTML="请您填写支付金额";
        lin.style.display="block";
        return;
    }
    else if(user_name=='')
    {
        var lin =  document.getElementById("bankconfir");
        lin.innerHTML="请您填写汇款人";
        lin.style.display="block";
        return;
    }
    else if(money !='')
    {
    var reg = new  RegExp('^\\d+(\\.\\d+)?$');
    if(!reg.exec(money))
    {
        var lin =  document.getElementById("bankconfir");
        lin.innerHTML="支付金额只能录入数值";
        lin.style.display="block";
        return;
    }
     }
  
    var comds=jQuery("#t_comd").val();  
   if(comd != '')
   {
    if(comds.length >50)
    {
        var lin =  document.getElementById("bankconfir");
        lin.innerHTML="只能录入50个汉字";
        lin.style.display="block";
        return;
    }
   }

    var outputDataUrl = "./outputData.aspx";
    
    var myurl = outputDataUrl;
         		    
    var pars = "";	   	  
    
      //jquery
     jQuery.get(myurl,{modify:"true",Dtype:"confimtransfer",Id:Id,Time:time,Num:num,Way:way,Name:name,Money:money,Comd:comd,Cdate:creatDate,TransferUserName:user_name},
     function(data)
                {
                   var tex = data;	        
                    if(tex == "") return;                    
                    //var lin =  document.getElementById("tag_box");
                      var lin =  jQuery(m_tagbox).get(0); 
                        
                        //lin.innerHTML = callEdJS(orderid,repstr);
                      if(tex == "ok")
                      {
                        jQuery(lin).html(callEdJSTrans(parameters));
                    
                        new dragObject(lin, "handle", null, null, null, null, null, false);  
                        lin.style.display="block";
                       // loadData('order',comparameters);
//                      if(parameters != '')
//                     {
//                       loadData_forsucceedorder('order',parameters,'true');
//                     }else
//                     {
//                       window.location.reload(true);  
//                     } 
                    
                      }
                        
                }
     );
     //jquery
    
    }
    
    //银行转账中确认付款4
    function callEdJSTrans(parameters){

    
     var sb = new StringBuilder('<div class="myddorder_popup_wrap" id="tag_box_trans">');
     
     sb.append(' <div class="myddorder_popup">');
     
      sb.append('<div class="myddorder_popup_title" id="handle">');
      
      sb.append(' <h2>付款确认</h2><a href=javascript:hidden_trans(\'',parameters,'\'); class="close" title="关闭">关闭</a>');
      
      sb.append('</div>');
      
      sb.append('<div class="myddorder_popup_main">');
      
      sb.append('<h3 class="icon_success status2"><i></i><span>提交成功</span></h3>');
      sb.append(' <p class="tips clearfix"><span class="nav">温馨提示：</span><span class="info">您已提交付款确认，请等待财务人员审核，通过审核后您的订单会继续执行。</span></p>');
      sb.append(' <div class="myddorder_popup_btn"><button  onclick="javascritpt:hidden_trans(\'',parameters,'\');">关闭窗口</button></div>');
     
      sb.append('</div>');
       sb.append('</div>');
        sb.append('</div>'); 
     return sb.getString();   

}


function hidden_trans(parameters)
{
    var lin = document.getElementById("tag_box_trans");
    if(lin)lin.style.display="none";
   
     if(parameters != '')
      {
         //loadData_forsucceedorder('order',parameters,'true');
         loadData_searchOrder('searchorder',parameters,0);
      }else
     {
        window.location.reload(true);  
     } 
}



















